package com.blue.pojo;

/**
 * Spring 会通过反射机制, 调用类的无参构造方法来实例化对象
 */
public class User {
    private String username;
    private Integer age;

    public User() {
        System.out.println("User 的无参构造函数执行了!");
    }

    public User(String username, Integer age) {
        this.username = username;
        this.age = age;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", age=" + age +
                '}';
    }
}
